import cgi
import os
import logging

import admin
import dispatcher

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

class MainPage(webapp.RequestHandler):
	
  def get(self):
	  logging.info("WebApp")
  
application = webapp.WSGIApplication(
                                     [('/', dispatcher.Dispatcher),
				      ('/dispatch/.*/.*', dispatcher.Dispatcher),
				      ('/admin/dispatch/.*/.*', dispatcher.Dispatcher),
                                      ('/admin/index.*', admin.Index),
                                      ('/admin/deleteAll', admin.DeleteAll),
                                      ('/admin/initAll', admin.Init),
                                      ],
                                     debug=True)


def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()

